import { mapGetters } from 'vuex'
export default {
	computed: {
		...mapGetters('cart', ['total'])
	},
	watch: {
		total: function(newV) {
			// 重置设置 tabBar 徽标
			uni.setTabBarBadge({
				text: newV + '',
				index: 2
			})
		}
	},
	onShow() {
		// 给tabBar设置数字徽标
		uni.setTabBarBadge({
			index: 2,
			text: this.total + ''
		})
	}
}